package com.tongda.core.utils;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Page<T> {

	private int total;

	private int pageSize;

	private boolean hasNextPage;

	private int pageNumber;

	private String dataStr;

	private ArrayList<T> dataList = new ArrayList<T>();

	public ArrayList<T> getDataList() {
		return dataList;
	}

	public void setDataList(ArrayList<T> dataList) {
		this.dataList = dataList;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getTotal() {
		return total;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public boolean isHasNextPage() {
		return (getPageNumber() * getPageSize()) < total;
	}

	public void setHasNextPage(boolean hasNextPage) {
		this.hasNextPage = hasNextPage;
	}

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public String getDataStr() {
		return dataStr;
	}

	public void setDataStr(String dataStr) {
		this.dataStr = dataStr;
	}
}
